#include "mainwindow.h"
#include "qwidgetcgcs2000tobj54.h"
#include "qwincoordinatechange.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    // 设置背景图片为bj.jpg
    this->setObjectName("mainWindow");
    this->setStyleSheet("#mainWindow{border-image:url(:/images/world.png);}");
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_action_exit_triggered()
{
    exit(0);
}


void MainWindow::on_action_bj54_to_cgcs2000_triggered()
{
    QWinCoordinateChange *w=new QWinCoordinateChange();
    w->setAttribute(Qt::WA_DeleteOnClose); //关闭时自动删除
    //w->setWindowTitle("基于QWidget的窗体，无父窗口，关闭时删除");

    w->setWindowFlag(Qt::Window,true);

//    formDoc->setWindowFlag(Qt::CustomizeWindowHint,true);
//    formDoc->setWindowFlag(Qt::WindowMinMaxButtonsHint,true);
//    formDoc->setWindowFlag(Qt::WindowCloseButtonHint,true);
//    formDoc->setWindowFlag(Qt::WindowStaysOnTopHint,true);

//    formDoc->setWindowState(Qt::WindowMaximized);
//    w->setWindowOpacity(0.9);
//    formDoc->setWindowModality(Qt::WindowModal);

    w->show(); //在单独的窗口中显示
}


void MainWindow::on_action_cgcs2000_to_bj54_triggered()
{
    QWidgetCGCS2000ToBJ54 *w=new QWidgetCGCS2000ToBJ54();
    w->setAttribute(Qt::WA_DeleteOnClose); //关闭时自动删除
    //w->setWindowTitle("基于QWidget的窗体，无父窗口，关闭时删除");

    w->setWindowFlag(Qt::Window,true);

//    formDoc->setWindowFlag(Qt::CustomizeWindowHint,true);
//    formDoc->setWindowFlag(Qt::WindowMinMaxButtonsHint,true);
//    formDoc->setWindowFlag(Qt::WindowCloseButtonHint,true);
//    formDoc->setWindowFlag(Qt::WindowStaysOnTopHint,true);

//    formDoc->setWindowState(Qt::WindowMaximized);
//    w->setWindowOpacity(0.9);
//    formDoc->setWindowModality(Qt::WindowModal);

    w->show(); //在单独的窗口中显示
}

